from colorama import Fore

import pinia
from FileHandlers.JsonFile import JReadSave, JWriteSave, JRead, JReadConfig, JWriteConfig, pip2Ui
from console_conpent.options import Options
from effect.util.console.SuperConsole import cls
from entiys.npc.NPCLoader import NPCLoader
from entiys.plugins.Loader import PluginLoader, VERSION, DEFA_VALUE
from game.TopClass import Windows


class SetPlugins(Windows):
    def __init__(self, *args, **kwargs):
        super().__init__(*args, **kwargs)

    def UiShow(self):
        cls()
        while True:
            command = input(">>>")
            if command.startswith("ui "):
                arg = command.split(" ")
                pip2Ui(" ".join(arg[1:]))
                print("界面指令发送成功")
            elif command == "exit":
                self.LastWindows.UiShow()
            elif command == "cls":
                cls()
            else:
                print(f"{Fore.RED} 错误的指令 {Fore.WHITE}")

    def Logic(self):
        ...
